From 028357555f72a59c1d8b75a39c28816528a185df Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 6 Apr 2009 02:11:42 +0000 Subject: [PATCH] * Made generateReason() skip deleted user names --- includes/Article.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 4a93240957..f77e246b82 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2185,18 +2185,16 @@ class Article { // Find out if there was only one contributor // Only scan the last 20 revisions - $limit = 20; $res = $dbw->select( 'revision', 'rev_user_text', - array( 'rev_page' => $this->getID() ), __METHOD__, - array( 'LIMIT' => $limit ) + array( 'rev_page' => $this->getID(), 'rev_deleted & '.Revision::DELETED_USER.'=0' ), + __METHOD__, + array( 'LIMIT' => 20 ) ); if( $res === false ) // This page has no revisions, which is very weird return false; - if( $res->numRows() > 1 ) - $hasHistory = true; - else - $hasHistory = false; + + $hasHistory = ( $res->numRows() > 1 ); $row = $dbw->fetchObject( $res ); $onlyAuthor = $row->rev_user_text; // Try to find a second contributor -- 2.20.1